import request from '@/utils/request'

// 获取列表
export const getList = (params) => {
  return request.get('/park/enterprise', {
    params
  })
}

// 删除
export const delList = (id) => {
  return request.delete(`/park/enterprise/${id}`)
}

// 下拉合同
export function getRentListAPI(id) {
  return request({
    url: `/park/enterprise/rent/${id}`
  })
}

export function getRentBuildListAPI() {
  return request({
    url: '/park/rent/building'
  })
}

export function createRentAPI(data) {
  return request({
    url: '/park/enterprise/rent',
    method: 'POST',
    data
  })
}

// 退租
export function outRentApi(rentId) {
  return request({
    url: `/park/enterprise/rent/${rentId}`,
    method: 'PUT'
  })
}
